﻿#include "dialogask.h"
#include "ui_dialogask.h"

#include <QTimer>
#include <QFile>
#include <QBitmap>

DialogAsk::DialogAsk(QString str, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogAsk)
{
    ui->setupUi(this);
    ui->label->setText(str);
    setWindowFlag(Qt::FramelessWindowHint);
    //setAttribute(Qt::WA_DeleteOnClose);
    QPixmap maskPixmap(":/Monster_Kill/Res/Img/DialogAsk.png");
    setMask(maskPixmap.mask());

}

DialogAsk::~DialogAsk()
{
    delete ui;
}

void DialogAsk::showLater()
{
    QTimer* timer = new QTimer();
    timer->start(400);
    timer->setSingleShot(true);
    connect(timer, &QTimer::timeout, this, &DialogAsk::show);

}

void DialogAsk::on_CancelBtn_clicked()
{
    emit CancelBtn();
    this->close();
}

void DialogAsk::on_OkBtn_clicked()
{
    emit OkBtn();
    this->close();
}
